﻿using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.ValueGeneration;
using ZeroSum.IdGenerator;

namespace ZeroSum.Extend.EFCore.MySql;

public class CreatedLongValueGenerator : ValueGenerator<long>
{
    public override bool GeneratesTemporaryValues { get; }

    public override long Next(EntityEntry entry)
    {
        if (entry == null) throw new ArgumentNullException(nameof(entry));

        return IDGenerator.Generate();
    }
}